package lzy.service.impl;

import lzy.entity.GinsengTraceability;
import lzy.mapper.GinsengTraceabilityMapper;
import lzy.service.GinsengTraceabilityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GinsengTraceabilityServiceImpl implements GinsengTraceabilityService {
    
    @Autowired
    private GinsengTraceabilityMapper ginsengTraceabilityMapper;
    
    @Override
    public GinsengTraceability findByTraceCode(String traceCode) {
        return ginsengTraceabilityMapper.findByTraceCode(traceCode);
    }
    
    @Override
    public List<GinsengTraceability> findByBatchNo(String batchNo) {
        return ginsengTraceabilityMapper.findByBatchNo(batchNo);
    }
    
    @Override
    public List<GinsengTraceability> findAll() {
        return ginsengTraceabilityMapper.findAll();
    }
    
    @Override
    public void addTraceability(GinsengTraceability record) {
        ginsengTraceabilityMapper.insert(record);
    }
    
    @Override
    public void updateTraceability(GinsengTraceability record) {
        ginsengTraceabilityMapper.update(record);
    }
    
    @Override
    public void deleteTraceability(String traceCode) {
        ginsengTraceabilityMapper.delete(traceCode);
    }
}